<!--  -->
<template>
  <div class="home">
    <!-- <home-header /> -->
    <component :is="homeCom[index]"></component>
  </div>
</template>

<script>
import HomeIndex from "./components/homeIndex";
import Furn from "./components/furniture";
import Cloth from './components/clothing'
// import Category from "./components/category";
import homeHeader from "./components/homeHeader";
import Shoe from './components/shoe'
import Phone from './components/phone';
import { mapState } from "vuex";
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  data() {
    return {
      homeCom: ["HomeIndex", "Furn","Cloth","Shoe","Phone","Furn","Furn","Furn","Furn"],
      num:0,

    };
  },
  //import引入的组件需要注入到对象中才能使用
  components: {
    homeHeader,
    // Category,
    HomeIndex,
    Furn,
    Cloth,
    Shoe,
    Phone
  },
  //监听属性 类似于data概念
  computed: {
    ...mapState(["index"]),
  },
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
  },
  beforeCreate() {}, //生命周期 - 创建之前
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {
    
  },
  beforeMount() {}, //生命周期 - 挂载之前
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
    
  },
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang="less" scoped>
.home {
  // height: 100vh;
  background-color: #f4f4f4;
  margin-bottom: 5rem;
  min-height: 100rem;
}
</style>